package com.dftdla.controller;

import com.dftdla.dao.pojo.ChatUser;
import com.dftdla.dao.service.ChatUserService;
import com.dftdla.result.ResponseResult;
import com.dftdla.util.Code;
import org.junit.jupiter.params.shadow.com.univocity.parsers.annotations.Validate;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * @author 14501
 */
@RestController
@RequestMapping("/user")
@Validated
public class UserController {

    @Resource
    private ChatUserService chatUserService;

    @RequestMapping("register")
    public String register(@Valid ChatUser user) {
        return new ResponseResult<>(Code.SUCCESS, chatUserService.register(user)).toString();
    }

}
